﻿#pragma once

#include <QWidget>
#include "ui_MiniMapWidget.h"
#include <MiniMapMaskWidget.h>

QT_BEGIN_NAMESPACE
namespace Ui { class MiniMapWidgetClass; };
QT_END_NAMESPACE

class GraphicsScene;

class MiniMapWidget : public QWidget
{
	Q_OBJECT

public:
	MiniMapWidget(QWidget* parent = nullptr);
	~MiniMapWidget();
	void setMinimapVisable(bool visable);
	void setScene(GraphicsScene* scene);
protected:
	virtual void paintEvent(QPaintEvent* event)override;
public slots:
	void onCenterMove(const QPoint& center);
	void onViewScaleChanged();
private:
	Ui::MiniMapWidgetClass* ui;
	const int m_padding = 20;
	GraphicsScene* m_scene = nullptr;
	MiniMapMaskWidget* m_maskWgt = nullptr;
	bool m_isVisable = true;
	// 理想尺寸大小
	const QSize m_perferredSize = QSize(150, 150);
};
